package yf.mall.entity.custom;


import java.io.Serializable;

public class PageQuery implements Serializable {


    /**
     * 默认每页显示的记录条数： {@value}
     */
    public static final int DEFAULT_PAGESIZE = 10;


    /**
     * 页码，从 1 开始
     */
    private int pageNumber = 1;

    /**
     * 每页显示的记录条数，默认值为 {@link #DEFAULT_PAGESIZE}
     */
    private int pageSize = DEFAULT_PAGESIZE;


    public PageQuery() {

    }

    public PageQuery(int pageNumber, int pageSize) {
        this.pageNumber = pageNumber;
        this.pageSize = pageSize;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public long getOffset() {
        return (long) (this.pageNumber - 1) * this.pageSize;
    }
}
